// import { createApp } from 'vue'
// import App from './App.vue'
// import { globalRegister } from './global'
// import router from './router'
// import store from './store'

// import 'normalize.css'
// import './assets/css/index.less'
// import './service/axios_demo'
// import { setupStore } from './store'

// // import ElElement from 'element-plus'
// // import 'element-plus/dist/index.css'

// const app = createApp(App)
// // app.use(ElElement)
// app.use(globalRegister)
// app.use(store)

// setupStore()
// app.use(router)

// app.mount('#app')

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import 'element-plus/dist/index.css'
import { globalRegister } from './global'
import { setupStore } from './store'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// 全局样式重置插件
import 'normalize.css'
import './assets/css/index.less'
const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// app.use方法在执行回调的时候, 会把app作为参数传递给回调函数
//调用globalRegister函数是执行函数实现属性的全局注册
app.use(globalRegister)
app.use(store)
// 页面刷新时vuex的数据会被清掉, 通过setup在页面加载的时候加载一下登录相关数据
// 注意: 这里的setupStore函数必须在路由注册之前调用, 否则刷新会404
setupStore()
app.use(router)

app.mount('#app')
